/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beanInfo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author VANTRUY
 */
@Entity
@Table(name = "CarBooking")
@NamedQueries({
    @NamedQuery(name = "CarBooking.findAll", query = "SELECT c FROM CarBooking c"),
    @NamedQuery(name = "CarBooking.findByCarBookID", query = "SELECT c FROM CarBooking c WHERE c.carBookID = :carBookID"),
    @NamedQuery(name = "CarBooking.findByRegDate", query = "SELECT c FROM CarBooking c WHERE c.regDate = :regDate"),
    @NamedQuery(name = "CarBooking.findByAirConditioner", query = "SELECT c FROM CarBooking c WHERE c.airConditioner = :airConditioner"),
    @NamedQuery(name = "CarBooking.findByPickupDate", query = "SELECT c FROM CarBooking c WHERE c.pickupDate = :pickupDate"),
    @NamedQuery(name = "CarBooking.findByDropoffDate", query = "SELECT c FROM CarBooking c WHERE c.dropoffDate = :dropoffDate"),
    @NamedQuery(name = "CarBooking.findByQty", query = "SELECT c FROM CarBooking c WHERE c.qty = :qty"),
    @NamedQuery(name = "CarBooking.findByTotalPrice", query = "SELECT c FROM CarBooking c WHERE c.totalPrice = :totalPrice"),
    @NamedQuery(name = "CarBooking.findByHourPenalty", query = "SELECT c FROM CarBooking c WHERE c.hourPenalty = :hourPenalty"),
    @NamedQuery(name = "CarBooking.findByPriceReturn", query = "SELECT c FROM CarBooking c WHERE c.priceReturn = :priceReturn"),
    @NamedQuery(name = "CarBooking.findByStatus", query = "SELECT c FROM CarBooking c WHERE c.status = :status")})
public class CarBooking implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "carBookID")
    private Integer carBookID;
    @Column(name = "regDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date regDate;
    @Column(name = "airConditioner")
    private Boolean airConditioner;
    @Column(name = "pickupDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date pickupDate;
    @Column(name = "dropoffDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dropoffDate;
    @Column(name = "qty")
    private Integer qty;
    @Column(name = "totalPrice")
    private BigDecimal totalPrice;
    @Column(name = "hourPenalty")
    private Integer hourPenalty;
    @Column(name = "priceReturn")
    private Integer priceReturn;
    @Column(name = "status")
    private Boolean status;
    @JoinColumn(name = "customerID", referencedColumnName = "customerID")
    @ManyToOne
    private Customer customer;
    @JoinColumn(name = "carID", referencedColumnName = "carID")
    @ManyToOne
    private Car car;

    public CarBooking() {
    }

    public CarBooking(Integer carBookID) {
        this.carBookID = carBookID;
    }

    public Integer getCarBookID() {
        return carBookID;
    }

    public void setCarBookID(Integer carBookID) {
        this.carBookID = carBookID;
    }

    public Date getRegDate() {
        return regDate;
    }

    public void setRegDate(Date regDate) {
        this.regDate = regDate;
    }

    public Boolean getAirConditioner() {
        return airConditioner;
    }

    public void setAirConditioner(Boolean airConditioner) {
        this.airConditioner = airConditioner;
    }

    public Date getPickupDate() {
        return pickupDate;
    }

    public void setPickupDate(Date pickupDate) {
        this.pickupDate = pickupDate;
    }

    public Date getDropoffDate() {
        return dropoffDate;
    }

    public void setDropoffDate(Date dropoffDate) {
        this.dropoffDate = dropoffDate;
    }

    public Integer getQty() {
        return qty;
    }

    public void setQty(Integer qty) {
        this.qty = qty;
    }

    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    public Integer getHourPenalty() {
        return hourPenalty;
    }

    public void setHourPenalty(Integer hourPenalty) {
        this.hourPenalty = hourPenalty;
    }

    public Integer getPriceReturn() {
        return priceReturn;
    }

    public void setPriceReturn(Integer priceReturn) {
        this.priceReturn = priceReturn;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (carBookID != null ? carBookID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CarBooking)) {
            return false;
        }
        CarBooking other = (CarBooking) object;
        if ((this.carBookID == null && other.carBookID != null) || (this.carBookID != null && !this.carBookID.equals(other.carBookID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beanInfo.CarBooking[carBookID=" + carBookID + "]";
    }

}
